package com.online.demo.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.solr.client.solrj.beans.Field;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

// 存储在Solr中的Content信息
// 只做展示 -- 查看具体内容的时候  根据id到mysql中进行具体的产找   这里只做全文索引
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ContentSolrEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @Field("id")
    public Integer id;

    @Field("item_title")
    public String title;

    @Field("item_img")
    public String img; // 标题图

    @Field("item_createTime")
    public Long createTime;

    @Field("item_typeName")
    public String typeName;

    @Field("item_pTypeName")
    public String pTypeName;

    @Field("item_userNickName")
    public String userNickName; // 用户昵称

    @Field("item_briefInfo")
    public String briefInfo; // 简介

    @Field("item_score")
    public Integer score;   // 积分， score > 某个值才可以查看内容

    // @Field("item_keywords")
    // public List<String> keywords;

    @Field("item_viewNum")
    public Integer viewNum; // 浏览次数

    @Field("item_likeNum")
    public Integer likeNum; // 点赞次数

    @Override
    public String toString() {
        return "ContentSolrEntity{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", img='" + img + '\'' +
                ", createTime=" + createTime +
                ", typeName='" + typeName + '\'' +
                ", pTypeName='" + pTypeName + '\'' +
                ", userNickName='" + userNickName + '\'' +
                ", briefInfo='" + briefInfo + '\'' +
                // ", keywords='" + keywords + '\'' +
                ", viewNum=" + viewNum +
                ", likeNum=" + likeNum +
                '}';
    }
}
